#!/bin/bash
#1 获取输入参数个数，如果没有参数，直接退出
FILE_COUNT=$#
if((FILE_COUNT==0)); then
    echo ">>> 错误：未传递文件参数！"
    echo "  用法：db2_docker.sh rootPassword"
    exit;
fi
ROOT_PASSWORD=$1

docker run -d \
    --privileged=true \
    -v /etc/localtime:/etc/localtime:ro \
    -p 50000:50000 \
    -e DB2INST1_PASSWORD=$ROOT_PASSWORD \
    -e LICENSE=accept \
    -e DBNAME=testdb \
    -v /opt/module/db2/database/:/database/ \
    --name db2 \
    docker.io/microsoft/mssql-server-linux


# ============= 本容器提供如下安装信息:============= 
# database：testdb
# username：db2inst1
# password：123456
# port：50000
# ============== jdbc依赖 ==============
# <dependency>
#     <groupId>com.ibm.db2.jcc</groupId>
#     <artifactId>db2jcc</artifactId>
#     <version>db2jcc4</version>
# </dependency>
#=============== url连接 ===============
# jdbc:db2://${host}:${port}/${dbName}